/*
 * @lc app=leetcode.cn id=598 lang=javascript
 *
 * [598] 范围求和 II
 */

// @lc code=start
/**
 * @param {number} m
 * @param {number} n
 * @param {number[][]} ops
 * @return {number}
 */
var maxCount = function(m, n, ops) {
    if (ops.length === 0) {
        return m * n
    }
    let l = 0
    let w = 0
    for (let index = 0; index < ops.length; index++) {
        const arr = ops[index];
        if (!l || arr[0] < l) {
            l = arr[0]
        }
        if (!w || arr[1] < w) {
            w = arr[1]
        }
    }
    return l * w
};
// @lc code=end

